package Com.aop.pojo;

import Com.aop.dao.DBUtils;

import java.sql.SQLException;

/**
 * 模拟主题和新闻的底层 delete 方法
 * */
public class Top__News_Daoimpl {
    /**
     * 删除多条新闻根据主题id
     *
     * */
    public int deleteNews(int ntid) throws SQLException {
       String sql="DELETE FROM `newsmanagersystem`.`news` WHERE ntid=?" ;
       return DBUtils.ExecuteUpdate(sql,new Object[]{ntid});
    }
    /**
     * 删除一条新闻主题id
     *
     * */
    public int deleteNewsid(int tid) throws SQLException {
        String sql="DELETE FROM `newsmanagersystem`.`topic` WHERE `tid` = ?" ;
        return DBUtils.ExecuteUpdate(sql,new Object[]{tid});
    }
}
